package com.saxon.shiro.service;

import com.saxon.shiro.mapper.TeacherMapper;
import com.saxon.shiro.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class TeacherServiceImpl implements TeacherService {

    TeacherMapper teacherMapper;

    @Autowired
    public void setTeacherMapper (TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }

    @Override
    public Teacher getTeacherByName (String name) {
        return teacherMapper.getTeacherByName (name);
    }

    @Async
    @Override
    public void Asyn () {
        try {

            Thread.sleep (5000);
            System.out.println ("方法结束");
        } catch (InterruptedException e) {


        }
    }
}
